package com.location.footprint.adapter;

import android.view.View;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.location.footprint.R;
import com.location.footprint.bean.CommentsChildBean;
import com.location.footprint.utils.GlideUtils;

import de.hdodenhof.circleimageview.CircleImageView;


public class CommentsMoreAdapter extends BaseQuickAdapter<CommentsChildBean, BaseViewHolder> {
    public CommentsMoreAdapter() {
        super(R.layout.item_comments, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, CommentsChildBean item) {
        if (helper.getLayoutPosition() > 0) {
            helper.itemView.setBackgroundResource(R.color.divider_gray);
        }
        CircleImageView img_avatar = helper.getView(R.id.img_avatar);
        GlideUtils.loadImageView(mContext, item.getAvatarPath(), img_avatar);
        TextView text_content = helper.getView(R.id.text_comment);
        text_content.setText(item.getComments());
        TextView text_name = helper.getView(R.id.text_name);
        text_name.setText(item.getNickName());
        helper.addOnClickListener(R.id.text_like);
        helper.addOnClickListener(R.id.text_comments);
        RecyclerView recyclerView = helper.getView(R.id.recyclerview_child);
        recyclerView.setVisibility(View.GONE);
    }


}
